import request from '@/utils/request'
import qs from 'qs'
import type {resgetword,reqtype,wordlist} from './type'

export function getworddata() :Promise<resgetword>{
    const url = '/word/getword'
    return request({
      url: url,
      method: 'get'
    })
}

export function deletworddata(id:number):Promise<reqtype> {
    const url = '/word/delete'
    return request({
      url: url,
      method: 'post',
      data: qs.stringify({id}),
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded'
    }
    })
}




export function addeworddata(data:wordlist) :Promise<reqtype>{
    const url = '/word/add'
    return request({
      url: url,
      method: 'post',
      data: qs.stringify(data),
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded'
    }
    })
}